﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/FrontSite.Master" Inherits="System.Web.Mvc.ViewPage" Title="前台首页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    修改密码
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">


    <script type="text/javascript">
        //刷新“btnLogin”为“btnLogout”
        $(document).ready(function () {
            document.getElementById("btnLogin").text = "退出";
        });

        //设置当前导航栏的样式为“已点击”
        jQuery(document).ready(function ($) {
            $('#lnkbtnSafetySetup').css("color", "red");
        })

        $(document).ready(function () {
            $.formValidator.initConfig({ onError: function (msg) { alert(msg) } });
            $("#txtOldPwd").formValidator({ onshow: "请输入旧密码", onfocus: "不能为空", oncorrect: "输入合法" }).InputValidator({ min: 1, onerror: "旧密码不能为空,请确认" });
            $("#txtNewPwd").formValidator({ onshow: "请输入新密码", onfocus: "密码不能为空", oncorrect: "密码合法" }).InputValidator({ min: 1, onerror: "新密码不能为空,请确认" });
            $("#txtConfirmPwd").formValidator({ onshow: "请输入重复密码", onfocus: "两次密码必须一致哦", oncorrect: "密码一致" }).InputValidator({ min: 1, onerror: "确认密码不能为空,请确认" }).CompareValidator({ desID: "txtNewPwd", operateor: "=", onerror: "2次密码不一致,请确认" });
        });

        $(document).ready(function () {
            $("#btnSub").click(function () {
                var txtOldPwd = $("#txtOldPwd").val();
                var txtNewPwd = $("#txtNewPwd").val();
                var txtConfirmPwd = $("#txtConfirmPwd").val();
                $.ajax({
                    type: "POST",
                    url: "updatePwd",
                    data: "txtOldPwd=" + txtOldPwd + "&&txtNewPwd=" + txtNewPwd + "&&txtConfirmPwd=" + txtConfirmPwd,
                    success: function () {
                        alert('修改成功！');
                    }
                });
                alert('修改成功！');
            });
        });

        $(document).ready(function () {
            var ma = $('#form1').validate();
            jQuery.extend(jQuery.validator.messages, {
                required: "必填项",
                remote: "Please fix this field.",
                email: "邮箱格式不正确,请确认",
                url: "URL地址格式错误，请确认",
                date: "日期格式错误，请确认",
                dateISO: "日期格式(ISO)错误，请确认.",
                number: "请输入数字",
                digits: "请输入整数",
                creditcard: "信用卡号码格式错误",
                equalTo: "两次输入不一致",
                accept: "后缀名错误",
                mobile: "手机号码格式错误",
                tel: "电话号码格式错误",
                mobileOrTel: "手机或电话号码格式错误",
                qq: "QQ号码格式错误",
                chinese: "请输入中文",
                idcard: "身份证号码格式错误",
                letter: "请输入字母",
                ip: "IP地址格式错误",
                zipcode: "邮政编码格式错误",
                maxlength: $.validator.format("最多输入 {0} 个字符"),
                minlength: $.validator.format("最少输入 {0} 个字符"),
                rangelength: $.validator.format("字符长度介于 {0} 到 {1} 之间"),
                range: $.validator.format("值大小介于 {0} 到 {1}之间"),
                max: $.validator.format("最大值不超过 {0}"),
                min: $.validator.format("最小值不小于 {0}")
            });
        });
    </script>

    <style type="text/css">
        .login-histroy-info, .changelog-info {
            text-align: center;
        }

            .login-histroy-info .info-uname {
                color: #1d61ad;
                font-weight: bold;
            }

        .login-histroy-result, .changelog-result {
            text-align: right;
            margin-bottom: 10px;
            margin-right: 140px;
        }

        .mod-reset-listnav .listnav-list {
            border-bottom: 1px solid #dfdfdf;
        }

        .mod-reset-listnav .listnav-list-item.active {
            border-left-color: #3891eb;
            background: #fff;
            width: 128px;
            color: #3891eb;
        }

        .mod-reset-content {
            width: 980px;
            margin-left: auto;
            margin-right: auto;
        }

        .main {
            width: 980px;
            margin-left: auto;
            margin-right: auto;
        }

        div {
            display: block;
        }

        .mod-reset-listnav .listnav-list {
            border-bottom: 1px solid #dfdfdf;
            width: 134px;
        }

        .mod-reset-listnav .listnav-list-item {
            display: block;
            padding-top: 17px;
            padding-bottom: 17px;
            line-height: 16px;
            height: 16px;
            width: 130px;
            background: none repeat scroll 0 0 #fff;
            border-left: 5px solid #f9f9f9;
            font-size: 16px;
            font-family: \5fae\8f6f\96c5\9ed1,\9ed1\4f53;
            background: none repeat scroll 0 0 #f9f9f9;
            text-align: center;
        }

        .mod-reset-listnav {
            width: 710px;
            height: 640px;
            border: 1px solid #dcdcdc;
        }

        .clearfix {
            zoom: 1;
        }

        .mod-reset-list table {
            z-index: 1;
            left: 387px;
            top: 220px;
            position: absolute;
            height: 48px;
            width: 490px;
            border-top-style: none;
            border-top-color: inherit;
            border-top-width: 0;
        }

        tbody {
            display: table-row-group;
            vertical-align: middle;
            border-color: inherit;
        }
    </style>
    <style>
        body {
            text-align: center;
        }

        .mod-reset-content clearfix {
            width: 70%;
            margin: 0 auto;
        }

        .mod-reset-list {
            border: 1px solid #dcdcdc;
            height: 640px;
            width: 710px;
        }

        .listnav-list-item.active {
            border-left-color: #3891eb;
            color: #3891eb;
            width: 130px;
        }

        .auto-style5 {
            height: 38px;
            width: 238px;
        }

        .auto-style6 {
            height: 38px;
            text-align: center;
            font-weight: bold;
            width: 238px;
        }

        .auto-style7 {
            height: 32px;
            text-align: center;
            font-weight: bold;
            width: 238px;
        }

        .auto-style8 {
            height: 32px;
            width: 238px;
        }

        .auto-style9 {
            height: 31px;
            text-align: center;
            font-weight: bold;
            width: 238px;
        }

        .auto-style10 {
            height: 31px;
            width: 238px;
        }

        .error {
            color: red;
        }
    </style>
    <div class="mod-reset-content clearfix">
        <div class="mod-reset-listtop">
            <p class="login-histroy-info">
                &nbsp;
            </p>
            <p class="login-histroy-info">
                &nbsp;
            </p>
            <p class="login-histroy-info">
                <img alt="" src="../../Content/images/smile.png" />
                经检测，您的帐号当前处于安全状态，请放心操作
            </p>
            <p class="login-histroy-info">
                &nbsp;
            </p>
            <p class="login-histroy-info">
                &nbsp;
            </p>
        </div>
        <div class="mod-reset-listnav left" style="float: left; width: 130px; height: 200px; border: 1px solid #dcdcdc; background: none repeat scroll 0 0 #f9f9f9;">
            <ul>
                <li class="listnav-list"><a class="listnav-list-item" href="loginHistory">登录记录</a> </li>
                <li class="listnav-list"><a class="listnav-list-item active" href="modifyPwd">修改密码</a> </li>
            </ul>
        </div>
        <div class="listnav right" style="border: 1px solid black; height: 200px; border: 1px solid #dcdcdc;">
            <table id="login-histroy-data">
                <tr>
                    <td class="auto-style6">旧密码：</td>
                    <td class="auto-style5">
                        <input id="txtOldPwd" type="password" name="action0" style="width: 150px" /></td>
                    <td>
                        <div id="txtOldPwdTip" style="width: 250px"></div>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style7">新密码：</td>
                    <td class="auto-style8">
                        <input id="txtNewPwd" type="password" name="action1" class="sz" style="width: 150px" /></td>
                    <td>
                        <div id="txtNewPwdTip" style="width: 250px"></div>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style9">确认密码：</td>
                    <td class="auto-style10">
                        <input id="txtConfirmPwd" type="password" name="action" class="sz" style="width: 150px" /></td>
                    <td>
                        <div id="txtConfirmPwdTip" style="width: 250px"></div>
                    </td>
                </tr>
                <tr>
                    <td class="auto-style7">
                        <input type="submit" id="btnSub" value="提交" /></td>
                    <td class="auto-style8">
                        <input id="BtnCancel" type="button" value="取消" onclick="document.getElementById('txtOldPwd').value = document.getElementById('txtNewPwd').value = document.getElementById('txtConfirmPwd').value = ''" /></td>
                </tr>
            </table>
        </div>
    </div>


</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="head" runat="server">
</asp:Content>
